package ph.gov.marikina.mcsmtms.rest.webservices.client;

import java.util.HashMap;

import org.apache.http.auth.AuthScope;
import org.apache.http.auth.Credentials;
import org.apache.http.client.CredentialsProvider;


public class SimpleCrendentialsProvider implements CredentialsProvider {
	private HashMap<String, Credentials> credentialsMap;
	
	public SimpleCrendentialsProvider() {
	}

	public SimpleCrendentialsProvider(Credentials defaultCredentials) {
		credentialsMap = new HashMap<String, Credentials>();
		credentialsMap.put(AuthScope.ANY.toString(), defaultCredentials);
	}

	@Override
	public void clear() {
		credentialsMap.clear();
		
	}

	@Override
	public Credentials getCredentials(AuthScope key) {
		return credentialsMap.get(key.toString());
	}

	@Override
	public void setCredentials(AuthScope key, Credentials credentials) {
		credentialsMap.put(key.toString(), credentials);
	}

}
